import requests

def query_task_status(task_id,api_key):

    # 请求 URL
    url = f"https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}"

    # 请求头
    headers = {
        "Authorization": f"Bearer {api_key}"
    }

    # 发送 GET 请求
    response = requests.get(url, headers=headers)

    # 检查响应状态码
    if response.status_code == 200:
        print("请求成功，响应数据：")
        print(response.json())
        return response
    else:
        print(f"请求失败，状态码：{response.status_code}")
        print(f"错误信息：{response.text}")
